import request from '@/utils/request'

export function fetchElectronicBoomList(params) {
  return request({
    url: '/electronicBoom/list',
    method: 'get',
    params: params
  })
}

export function fetchallElectronicBoom() {
  return request({
    url: '/electronicBoom/fetchall',
    method: 'get'
  })
}

export function createElectronicBoom(data) {
  return request({
    url: '/electronicBoom/create',
    method: 'post',
    data: data
  })
}

export function updateElectronicBoom(id, data) {
  return request({
    url: '/electronicBoom/update/'+id,
    method: 'post',
    data: data
  })
}

export function deleteElectronicBoom(id) {
  return request({
    url: '/electronicBoom/delete/'+id,
    method: 'post'
  })
}

export function fetchElectronicBoomItemList(id, params) {
  return request({
    url: '/electronicBoomItem/list/'+id,
    method: 'get',
    params: params
  })
}

export function addElectronicBoomItem(data) {
  return request({
    url: '/electronicBoomItem/add',
    method: 'post',
    data: data
  })
}

export function updateElectronicBoomItem(id, count) {
  return request({
    url: '/electronicBoomItem/update',
    method: 'post',
    params: {id: id, count: count}
  })
}

export function deleteElectronicBoomItem(ids) {
  return request({
    url: '/electronicBoomItem/delete',
    method: 'post',
    params: ids
  })
}
